1. Field of the Invention
The invention relates to data rate synchronization of two devices and more particularly to the synchronization of a serial bus data rate to the data rate of an isochronous serial bus device.
2. Description of the Related Art
Computer systems are becoming ever more powerful with each passing moment. Many new advanced bus structures such as PCI or Peripheral Component Interchange bus have been developed to allow greater performance of the computer system. Additionally, new devices and uses are being developed for the computer systems. In the past the computer has been essentially a standalone device or networked with other computer systems. However, today the modern personal computer is becoming a much more connected and multimedia oriented system. For example, now high speed video and audio devices are becoming commonplace and the integration with the telephone system has already begun.
However, many of these new functions are well below the ultimate bandwidth or capability of the advanced buses such as the PCI bus. Therefore, it is not efficient to connect each one of the new functions and devices to the PCI bus directly, as this would impact bus loading and greatly increase overall costs. Additionally, many of these new functions are essentially serial in nature, with the data transferred in a bit stream rather than over a parallel bus structure. This is provided for many reasons, such as reduced wiring costs and can be done because of the lower data rates which are required.
Therefore, it has been proposed to develop a serial bus organization to connect all of these various lower bandwidth devices. The serial bus is organized with a host controller having a series of ports, which can then be connected either directly to devices or functions or to further hubs which have below them further devices or functions. A hub or the host controller may in addition incorporate functions if desired. In this manner a tree structure can be developed to allow a reasonable number of functions or devices to be attached to the serial bus system. The host controller connects to a bus in the computer system, for example the PCI bus, through the host controller. By having the host controller act as a concentrator, only a single connection to the PCI bus is necessary. The connection is better able to utilize the performance of that PCI bus without requiring numerous connections.
The host controller, each hub, and each function or port contain particular control registers for performing set up and initialization operations. In addition, four basic types of data transfer are defined in the serial bus system. The first type is isochronous, which is effectively a continuous real time transfer, such as telephony information or audio information. The second type is asynchronous block transfers, such as printer operations and conventional serial port operations, while the third type is asynchronous interactive device transfers, such as keyboard, mouse, pointing device, pen interfaces, and the configuration and status information, generally referred to as the control information, of the various devices. The fourth type is a polling or interrupt type which is used to periodically access a device to determine if it has any status change to report back to controlling software for the device.
Information is transferred over the serial bus during a window or period of time known as a frame. The host controller is responsible for generating the frame timing for the serial bus. The frame period is further divided into smaller time slots according to a prioritization scheme and the data requirements of the serial bus devices requiring service. Each device is generally allocated one time slot each frame, thus, the serial bus devices have relatively low data rates as compared to the relatively high serial bus data rate. For example, an isochronous device with a 64 Kbps data rate requirement can easily be satisfied by the 12 Mbps serial bus data rate. Thus, while the instantaneous transfer data rate to the isochronous device would be at the 12 Mbps serial bus data rate, because only a small portion of time per frame is required, the data rate of 64 Kbps can be effectively achieved with the small bursts of high speed data and a data buffer.
Information is broadcast over the serial bus system from the host controller in a series of packets, with the host controller acting as the bus master and hubs and devices only responding upon request or polling access of the host controller. The packet types include data packets, token packets for use from host to device, a handshake packet and a special control packet. Data packets are the isochronous, asynchronous block, and asynchronous control types. Token packets allow transfer of data packets. Handshake packets are used to perform a ready handshake after transfer of a data or control packet to acknowledge successful receipt or indicate unsuccessful receipt. Special control packets are used for logical reset and status request transfers. More details are found in the Universal Serial Bus Specification, version 0.9, published by Intel Corp., hereby incorporated by reference.
Since isochronous transfers by definition require a steady stream of data in real time, one particularly important concern is for isochronous devices to synchronize to the serial bus data rate to prevent overruns or underruns of data. One method of synchronizing the data flow is to exchange a predetermined amount of data during each frame according to the data requirement of the isochronous device. This method provides a great deal of synchronization, but if the clocks do not have a common denominator or if the clock frequencies drift, a serious overrun or underrun of data could gradually build over several frames of data. Therefore it is desirable to provide further synchronization as to the clock of the isochronous device to synchronize to the clock of the host controller.
With regard to providing synchronization to serial bus devices, a special type of token packet called a start of frame (SOF) packet is provided by the host controller. As part of the SOF packet, a time stamp, or clock tick, is provided for devices attached to the serial bus to differentiate frames and to synchronize to the serial bus clock. Thus, the host controller is the clock master with regard to serial bus timing. The period of time from one SOF packet to a subsequent SOF packet is defined as a frame, typically 1 ms.
However, some isochronous devices receive their clock from an external source and therefore cannot modify their data rates to match the serial bus clock rate. One such example is an Integrated Services Digital Network (ISDN) device. ISDN devices receive a fixed clock from the telephone line and, thus, cannot modify their clock to synchronize to the serial bus clock. Thus, even if the data rates are matched, if the clocks do not have a common denominator or if the clock frequencies drift over a period of time, an overrun or underrun of data could accumulate causing a loss of data.
Therefore, as it is desired to not preclude the use of ISDN or similar devices on the serial bus, it is therefore desirable to devise a method or apparatus for allowing the isochronous device and the serial bus to operate in synch so as to supply a steady stream of data without overruns or underruns. It is further desirable to allow the isochronous device to act as the serial bus clock master and account for small variations in clock changes.